import { processor } from '@/stores'
import api from '../apis'

const result = processor({
  loading: false,
  list: [],
  pagination: {}
}, {
  tableAction: (state, params) => {
    const { payload } = params || {}
    state.loading = !!payload.loading
    state.pagination = payload.pagination
    state.list = payload.data
  }
}, {
  caller: api,
  items: [
    {
      name: 'requestTable',
      callee: 'getCourseList'
    }
  ]
})

const { actions, requests } = result || {}

export default result
